package com.fowo.api.model.inventory.list;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fowo.api.common.excel.ChildExcelProperty;
import com.fowo.api.common.model.ImportRow;
import com.fowo.api.common.validator.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import javax.validation.constraints.*;
import lombok.Data;

/**
 * 盘点单 预览导入辅助模型(全字段为文本类型)
 * @author yl_ls
 */
@Data
public class InventoryListImportPo {

  /** 盘点单号 */
  @ExcelProperty("盘点单号")
  private String inventoryNumber;

  /** 盘点仓库 */
  @ExcelProperty("*盘点仓库")
  @NotBlank(message = "盘点仓库不能为空")
  @Size(max = 50, message = "盘点仓库长度不能超过50")
  private String warehouseStockName;

  @ExcelIgnore
  @Schema(title = "*盘点仓库")
  private String warehouseStock;

  /** 盘点类型 */
  @ExcelProperty("*盘点类型")
  @NotBlank(message = "盘点类型不能为空")
  private String inventoryType;

  /** 产品种类 */
  @ExcelProperty("产品种类")
  private String productCategory;

  /** 盘点人 */
  @ExcelProperty("*盘点人")
  @NotBlank(message = "盘点人不能为空")
  @Size(max = 50, message = "盘点人长度不能超过50")
  private String countPeopleName;

  @ExcelIgnore
  @Schema(title = "*盘点人")
  private String countPeople;

  /** 盘点状态 */
  @ExcelProperty("盘点状态")
  @EnumsString(
    value = { "待盘点_预锁", "待盘点", "盘点中", "已盘点", "已作废", "待审批" },
    message = "盘点状态只能是“待盘点_预锁”, “待盘点”, “盘点中”, “已盘点”, “已作废”, “待审批”中的一个"
  )
  private String status;

  /** 明盘盲盘 */
  @ExcelProperty("*明盘盲盘")
  @NotBlank(message = "明盘盲盘不能为空")
  @EnumsString(
    value = { "明盘", "盲盘" },
    message = "明盘盲盘只能是“明盘”, “盲盘”中的一个"
  )
  private String blindPlate;

  /** 零库存参与盘点 */
  @ExcelProperty("*零库存参与盘点")
  @NotBlank(message = "零库存参与盘点不能为空")
  @BooleanString(message = "零库存参与盘点格式不正确，请使用“是”，“否”")
  private String zeroParticipation;

  /** 备注 */
  @ExcelProperty("备注")
  @Size(max = 50, message = "备注长度不能超过50")
  private String remark;

  /** 盘点明细 */
  @ChildExcelProperty
  private List<ImportRow<InventoryListAndInventoryListSubtableImportPo>> generateInventoryDetails;
}
